cmake_minimum_required (VERSION 3.8)

project(x2lib_objs)


IF(CMAKE_BUILD_TYPE MATCHES "Debug" AND WIN32)
	add_definitions(-D__DEBUG__)
	add_definitions(-D__WIN32__)
	add_definitions(-D_LIB)
	add_definitions(-D_CRT_SECURE_NO_WARNINGS)
ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND WIN32)
	add_definitions(-D__WIN32__)
	add_definitions(-D_LIB)
	add_definitions(-D_CRT_SECURE_NO_WARNINGS)
ELSEIF(CMAKE_BUILD_TYPE MATCHES "Debug" AND UNIX)
	add_definitions(-D__DEBUG__)
	add_definitions(-D__LINUX__)
	add_definitions(-fpermissive)
ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND UNIX)
	add_definitions(-D__LINUX__)
	add_definitions(-fpermissive)
ENDIF()

file(GLOB x2lib_srcs "*.c*" "open/*.c*" "open/depends/*.c*")
add_library(x2lib_objs OBJECT ${x2lib_srcs})
